import { provide, ref } from "vue";

export default function DetailForm() {
  /**
   * 详情窗口是否显示
   */
  const detailFormDialogVisible = ref(false);
  provide("detailFormDialogVisible", detailFormDialogVisible);

  /**
   * 改变详情窗口的显示状态
   */
  const changeDetailFormDialogVisibleValue = () => {
    detailFormDialogVisible.value = !detailFormDialogVisible.value;
  };
  provide(
    "changeDetailFormDialogVisibleValue",
    changeDetailFormDialogVisibleValue
  );

  return {
    detailFormDialogVisible,
    changeDetailFormDialogVisibleValue,
  };
}
